const path = require('path')
module.exports = ({ file }) => {
  // console.log('file===', file)
  const designwWidth = file.includes(path.join('node_modules', 'vant')) ? 375 : 750
  // console.log(designwWidth)
  return {
    plugins: {
      autoprefixer: {
        overrideBrowserslist: [
          'Android 4.1',
          'iOS 7.1',
          'Chrome > 31',
          'ff > 31',
          'ie >= 8',
          'last 2 versions' // 所有主流浏览器最近2个版本
        ],
        grid: true
      },
      'postcss-px-to-viewport': {
        viewportWidth: designwWidth,
        // exclude: /\/src\//,
        propList: ['*'],
        mediaQuery: true // 媒体查询里的单位是否需要转换单位
      }
    }
  }
}
